
all: bin2mem inst_rom.S
	riscv32-unknown-elf-as -march=rv32im inst_rom.S -o inst_rom.o
	riscv32-unknown-elf-ld -T ram.lds inst_rom.o -o inst_rom.elf
	riscv32-unknown-elf-objcopy -O binary -S inst_rom.elf inst_rom.bin
	riscv32-unknown-elf-objdump -D inst_rom.elf > inst_rom.dump
	./bin2mem inst_rom.bin inst_rom.data

bin2mem:
	gcc bin2mem.c -o bin2mem

clean:
	rm -rf *.o *.elf *.bin *.dump *.data bin2mem

